<template>
	<view class="modular">
		<view class="headerBox">
			<view class="header">
				<view class="information">
					<view>
						<view><text>会员</text>：{{headerInformation.realName}} </view>
						<view><text>填写日期</text>：{{headerInformation && headerInformation.medicalTime}}</view>
					</view>
					<view>
						<view><text>性别</text>：{{userInfo && userInfo.sex == 1 ? '男' : '女'}} </view>
						<view><text>年龄</text>：{{userInfo && userInfo.age}}</view>
					</view>
					<view>
						<view><text>评估人</text>：{{headerInformation && headerInformation.signName}}</view>
						<view><text>评估日期</text>：</view>
					</view>
				</view>
			</view>
			
			<view class="connectBox" v-show="!searchBarFixed">
				<image src="@/static/img/healthStatus/connect@2x.png"></image>
				<image src="@/static/img/healthStatus/connect@2x.png"></image>
			</view>
		</view>
		
		<view class="mainContent">
			<view class="listModular">
				<image  :src="item" v-for="(item,index) in headerInformation.imgUrls" :key="index"></image>
			</view>
		</view>
	</view>
</template>

<script>
	import {getUrlParam,filterData2,distance} from '@/static/js/filter.js';
	export default {
		data () {
			return {
				searchBarFixed: false,
				headerInformation:{},
				userInfo:{}
			}
		},
		methods: {
			filterData2,
			distance,
		},
		onPageScroll() {
			this.searchBarFixed = this.distance('mainContent');
		},
		onLoad() {
			const id = getUrlParam('id');
			if(id) {
				this.$api.MedicalfindbyId(id).then((res) => {
					if(res.data.returnCode == '200') {
						this.headerInformation = res.data.result;
						console.log(this.headerInformation)
						this.userInfo = localStorage.getItem('userInfo') && JSON.parse(localStorage.getItem('userInfo'));
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import '@/static/css/healthStatus/toView.scss';
	.listModular {
		box-sizing: border-box;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		background-color: #FFFFFF;
		padding: 60upx 39upx 0;
		image {
			width: 256upx;
			height: 332upx;
			border-radius: 12upx;
			margin-bottom: 60upx;
		}
	}
</style>
